{% if is_paginated %}
<nav>
    <ul class="pagination" >
        <li>
        {% if page_obj.has_previous %}
            <a href="?page={{ page_obj.previous_page_number }}{{ getvars }}{{ hashtag }}" class="prev">&lsaquo;&lsaquo; </a>
        {% else %}
            <span class="disabled prev">&lsaquo;&lsaquo; </span>
        {% endif %}
        </li>
        {% for page in pages %}
            {% if page %}
                {% ifequal page page_obj.number %}
                    <li class="active"><span class="current page">{{ page }}</span></li>
                {% else %}
                    <li><a href="?page={{ page }}{{ getvars }}{{ hashtag }}" class="page">{{ page }}</a></li>
                {% endifequal %}

            {% else %}
                ...
            {% endif %}
        {% endfor %}
        <li>
        {% if page_obj.has_next %}
            <a href="?page={{ page_obj.next_page_number }}{{ getvars }}{{ hashtag }}" class="next"> &rsaquo;&rsaquo;</a>
        {% else %}
            <span class="disabled next"> &rsaquo;&rsaquo;</span>
        {% endif %}
        </li>
    </ul>
</nav>
{% endif %}
